/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.ofbiz.eclipse.model.webapp.SiteConf.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.ofbiz.eclipse.model.webapp.SiteConf.DefaultRequestType;
import org.ofbiz.eclipse.model.webapp.SiteConf.SiteConfPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Default Request Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.ofbiz.eclipse.model.webapp.SiteConf.impl.DefaultRequestTypeImpl#getRequestUri <em>Request Uri</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DefaultRequestTypeImpl extends EObjectImpl implements DefaultRequestType {
	/**
	 * The default value of the '{@link #getRequestUri() <em>Request Uri</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRequestUri()
	 * @generated
	 * @ordered
	 */
	protected static final String REQUEST_URI_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getRequestUri() <em>Request Uri</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRequestUri()
	 * @generated
	 * @ordered
	 */
	protected String requestUri = REQUEST_URI_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected DefaultRequestTypeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return SiteConfPackage.Literals.DEFAULT_REQUEST_TYPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getRequestUri() {
		return requestUri;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setRequestUri(String newRequestUri) {
		String oldRequestUri = requestUri;
		requestUri = newRequestUri;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, SiteConfPackage.DEFAULT_REQUEST_TYPE__REQUEST_URI, oldRequestUri, requestUri));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case SiteConfPackage.DEFAULT_REQUEST_TYPE__REQUEST_URI:
				return getRequestUri();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case SiteConfPackage.DEFAULT_REQUEST_TYPE__REQUEST_URI:
				setRequestUri((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case SiteConfPackage.DEFAULT_REQUEST_TYPE__REQUEST_URI:
				setRequestUri(REQUEST_URI_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case SiteConfPackage.DEFAULT_REQUEST_TYPE__REQUEST_URI:
				return REQUEST_URI_EDEFAULT == null ? requestUri != null : !REQUEST_URI_EDEFAULT.equals(requestUri);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (requestUri: ");
		result.append(requestUri);
		result.append(')');
		return result.toString();
	}

} //DefaultRequestTypeImpl
